package com.xcity.game.battle.pve.employee.impl;

import com.xcity.game.battle.pve.PlayerBattler;
import com.xcity.game.battle.pve.employee.EmployeeSkillBattleContext;
import com.xcity.game.common.GameStaticConfig;
import com.xcity.game.employee.skill.EmployeeSkill;

//{1=90032#0}{2=90039#0}{3=90041#0}{4=90042#0}共同出场时，每次攻击有{0=50#0}%几率冻结对手使对手下次攻击无效
public class SKILL_42_CONTEXT extends EmployeeSkillBattleContext {

	private boolean nextTurnTrigger;
	
	public SKILL_42_CONTEXT(PlayerBattler player, EmployeeSkill ref) {
		super(player, ref);
	}

	@Override
	public boolean trigger() {
		if (nextTurnTrigger) {
			nextTurnTrigger = false;
			return true;
		}
		int n = rnd.nextInt(GameStaticConfig.percentBase);
		if (n < ref.getTemplate().getInitVal(0)) {
			nextTurnTrigger = true;
		}
		return false;
	}

}
